package com.hr.fer.nmbp.lab2.service;

import org.apache.ibatis.session.SqlSession;

import com.hr.fer.nmbp.lab2.persistence.ReservationMapper;
import com.hr.fer.nmbp.lab2.persistence.RoomMapper;

public class RoomDAO {
	
	private RoomMapper roomMapper;
	private ReservationMapper reservationMapper;
	
	public RoomDAO(SqlSession session){
		roomMapper = session.getMapper(RoomMapper.class);
		reservationMapper = session.getMapper(ReservationMapper.class);
	}
	
	public void deleteRoom(int roomNum) {
		reservationMapper.deleteByRoomNumber(roomNum);
		roomMapper.deleteByPrimaryKey(roomNum);
	}
	
}
